async function login() {
  // 准备参数
  let option = {
    url: 'http://146.56.230.35:3007/users/login',
    data: { username: 'root123', userPassword: 'root123' },
    method: 'post',
  }
  // 发送请求
  try {
    let res = await request(option)
    console.log(res)
    if (res.code !== 200) {
      return alert(res.msg)
    }
  } catch (error) {
    console.log(error)
  }
}

// login()

async function getUserList() {
  let opt = {
    url: 'http://146.56.230.35:3007/users/userList',
    data: {
      userName: '',
      page: 1,
      pageSize: 10,
    },
    headers: {
      token:
        'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NDMsImlhdCI6MTY2ODA2MTc5OSwiZXhwIjoxNjY4MTQ4MTk5fQ.KfRw6JXITh0BEBoQvSx4LT22l7wnxSSK438y_3EM7VY',
    },
  }
  // 发送请求
  try {
    let res = await request(opt)
    console.log(res)
    if (res.code !== 200) {
      return alert(res.msg)
    }
  } catch (error) {
    console.log(error)
  }
}
getUserList()
